<template>
  <el-dialog
    title="选择场地"
    :visible.sync="selectClassRoomDialog"
    width="1500px"
    class="xzjy"
  >
    <div>
      <div class="top-tab-query">
        <div class="tab">
          <div
            :class="selectTab == 'jzw' ? 'tab-active' : 'tab-no-select'"
            @click="tabClick('jzw')"
          >
            按建筑物
          </div>
          <div
            :class="selectTab == 'bm' ? 'tab-active' : 'tab-no-select'"
            @click="tabClick('bm')"
          >
            按部门
          </div>
          <div
            :class="selectTab == 'lx' ? 'tab-active' : 'tab-no-select'"
            @click="tabClick('lx')"
          >
            按类型
          </div>
        </div>
        <div class="query-tab">
          <div class="tab-no-select">搜索</div>
          <div>
            <el-input v-model="queryName" placeholder="请输入内容"></el-input>
          </div>
          <div class="search-button">
            <img src="../../../../assets/assessment/icon-search.png" alt="" />
            <span @click="queryInfo">查询</span>
          </div>
        </div>
      </div>
      <el-row style="width: 100%; overflow: hidden">
        <el-col :span="4">
          <el-tree
            default-expand-all
            :data="data"
            :props="defaultProps"
            @node-click="handleNodeClick"
            style="color: #004ca7; margin: 20px 40px; background: #f0f2f5"
          ></el-tree>
        </el-col>
        <el-col :span="20" class="border-left">
          <div class="assessment-container" style="width: 100%">
            <div
              class="table-container"
              style="width: calc(100% - 100px); margin: 10px auto"
            >
              <el-table
                :data="tableData_place"
                border
                class="table-data"
                row-class-name="row-class"
                cell-class-name="cell-class"
                header-row-class-name="header-row-class"
                header-cell-class-name="header-cell-class"
                style="height: 345px; overflow-y: auto"
                @selection-change="handleSelectionChange"
              >
                <el-table-column align="center" type="selection" width="80">
                </el-table-column>
                <el-table-column
                  prop="cdcsmc"
                  label="场地场所名称"
                  align="center"
                >
                </el-table-column>
                <el-table-column
                  prop="area"
                  label="面积(平方米)"
                  align="center"
                >
                </el-table-column>
                <el-table-column
                  prop="rnrs"
                  label="容纳人数"
                  width="130"
                  align="center"
                >
                </el-table-column>
                <el-table-column
                  prop="cdcslx"
                  label="场地场所类型"
                  align="center"
                >
                </el-table-column>
                <el-table-column prop="ssxq" label="所属校区" align="center">
                </el-table-column>
                <el-table-column prop="ssjzw" label="所属建筑物" align="center">
                </el-table-column>
                <el-table-column prop="glbm" label="管理部门" align="center">
                </el-table-column>
                <el-table-column prop="lc" label="楼层" align="center">
                </el-table-column>
              </el-table>
            </div>
          </div>
          <div class="btn-caozuo">
            <ButtonItem
              @click="submitCDXZDialog"
              :name="'确定'"
              :link="''"
              :icon="''"
              :buttonColor="'yellow'"
            ></ButtonItem>
          </div>
        </el-col>
      </el-row>
    </div>
    <div style="height: 40px"></div>
  </el-dialog>
</template>

<script>
import ButtonItem from "@/components/ButtonItem.vue";
import {
  queryPlaceTimeTable,
  queryPlaceByTypeAndName,
} from "@/api/trainingManagement/place.js";

export default {
  components: {
    ButtonItem,
  },
  data() {
    return {
      selectTab: "jzw", //选择建筑物标签
      queryName: "", //查询关键字
      tableData_place: [], //场地列表
      selectClassRoomDialog: false, //选择教学场地
      // 选择列表数据
      multipleSelection: [],
      // 校区列表
      data: [
        {
          label: "2022",
          children: [
            {
              label: "英语[本科]",
              children: [],
            },
          ],
        },
        {
          label: "2021",
          children: [
            {
              label: "英语[本科]",
            },
            {
              label: "英语[本科]",
            },
          ],
        },
      ],
      defaultProps: {
        children: "children",
        label: "label",
      },
    };
  },
  methods: {
    submitCDXZDialog() {
      this.selectClassRoomDialog = false;
    },
    // tab切换
    tabClick(str) {
      this.selectTab = str;
    },
    queryInfo() {},
  },
};
</script>

<style lang="less" scoped>
.assessment-container {
  .el-dialog__body {
    height: 251px;
  }
  .el-dialog__footer {
    padding: 10px 20px 45px;
  }
  .el-checkbox__inner:hover {
    border-color: #004ca7;
  }
  .el-checkbox__inner {
    border: 1px solid #004ca7;
    border-radius: 0;
    height: 18px;
    width: 18px;
  }
  .el-checkbox__inner::after {
    height: 10px;
    left: 6px;
  }
  .el-checkbox__input.is-checked .el-checkbox__inner,
  .el-checkbox__input.is-indeterminate .el-checkbox__inner {
    background-color: #004ca7;
    border-color: #004ca7;
  }
  .el-checkbox__input.is-checked + .el-checkbox__label {
    color: #004ca7;
  }
  .el-checkbox.is-bordered.is-checked {
    border-color: #004ca7;
  }
  .el-checkbox__input.is-focus .el-checkbox__inner {
    border-color: #004ca7;
  }
}
</style>
<style lang="less" scoped>
@import "../../../../styles/text.less";
@import "../../../../styles/supervision.less";

/deep/ .table-container {
  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }

  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }

  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }

  .wrapper-button {
    display: flex;
    flex-direction: column;
    align-items: center;

    > div {
      margin-bottom: 8px;
    }
  }
  .table-data {
    width: 100%;
    border: 0.8px solid #004ca7;
    /*border-radius: 9px;*/
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}

/deep/.el-date-editor.el-input {
  width: 110px;
}
/deep/ .el-input--medium {
  width: 110px;
  .el-input__inner {
    height: 28px;
    width: 110px;
    padding: 0px 18px;
  }
}
/deep/ .el-table thead {
  color: #004ca7 !important;
}

.btn {
  margin-top: 271px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 271px;
  .submit {
    width: 84px;
    height: 27px;
    line-height: 8px;
  }
}

.search-button {
  width: 77px;
  height: 28px;
  line-height: 28px;
  background: #f1f8fe;
  border: 1px solid #51aef6;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  > span {
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #51aef6;
  }
  > img {
    width: 20px;
    height: 20px;
    margin-right: 4px;
  }
}

/deep/ .xzjy .el-dialog__body {
  padding: 0 !important;
  .wrapper-container {
    width: 100% !important;
  }
  .wrapper-container .search-container .search-container-left {
    margin-left: 20px;
    flex-wrap: wrap;
    .search-container-item {
      width: 200px;
      margin-right: 10px;
      .box {
        > span {
          text-align: left;
          width: 80px;
        }
        display: flex;
        justify-content: space-evenly;
        margin-bottom: 20px;
        align-items: center;
        .el-input--medium .el-input__inner {
          height: 28px;
        }
      }
    }
  }
}

/deep/ .el-tree-node__expand-icon.expanded {
  color: rgb(0, 76, 167);
}

.xzjy .tree {
  padding: 30px;
  color: rgb(0, 76, 167);
  font-weight: bold;
  font-size: 16px;
}

.top-tab-query {
  margin-top: 20px;
  border-bottom: 1px solid #004ca7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 160px 0 40px;

  .tab {
    display: flex;
    width: 500px;
    align-items: center;
    justify-content: space-around;
  }

  .tab-active {
    padding: 10px 20px;
    background: #004ca7;
    border-radius: 10px 10px 0 0;
    color: #fff;
    font-weight: bold;
    width: 110px;
    text-align: center;
    cursor: pointer;
  }

  .tab-no-select {
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    color: #004ca7;
    font-weight: bold;
    background: #c7d7eb;
    width: 110px;
    text-align: center;
    cursor: pointer;
  }

  .query-tab {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 400px;
  }
}

.border-left {
  padding: 0px 30px;
  border-left: 1px solid #004ca7;
}
.btn-caozuo {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 800px;
  margin: 0 auto;
  padding-top: 20px;
}
</style>
